function geturlitem(url, name) {
	urlstart = url.indexOf(name + "=");
	if(urlstart != -1) {
		urlstart = urlstart + name.length + 1;
		urlend = url.indexOf("&", urlstart);
		if(urlend == -1) urlend = url.length + 1;
		return url.substring(urlstart, urlend);
	}
	return "";
}

function pddenglu() {
	currentUser = AV.User.current();
	href = "denglu.html?RetUrl=" + getPageUrl() + "&" + geturl();
	$(".top_a ul li").eq(1).html("<a href=" + href + ">登录</a>")
	if(currentUser) {
		$(".top_a ul li").eq(0).html("欢迎【" + currentUser.attributes.username + "】|");
		$(".top_a ul li").eq(1).html("<a>退出登录</a>");
		$(".top_a ul li").eq(1).bind("click", function() {
			localStorage.clear();
			location.href = location.href;
		})
	}
}

function getPageUrl() {
	var index = location.pathname.lastIndexOf("/") + 1;
	var i = location.pathname.substr(index);
	//			console.log(i)
	return escape(i)
}

function geturl() {
	var u = location.search;
	u = u.substring(1, (u.length))
	console.log(u);
	return u;
}

function getcontent() { //网页内容
	var shangtype = (biao == "Ancient_Porcelai" ? "古瓷杂项" : (biao == "Chinese_Painting" ? "书画" : (biao == "Contemporary_Crafts" ? "当代工艺" : (biao == "Canvas" ? "油画雕塑" : ""))))
	$(".contain .place a").eq(1).html(obj.title);
	//	$(".simgbox .jp_item").html()
	$(".mainatrright>h2").html(obj.title);
	$(".summary ul li").eq(0).html("上架时间：" + obj.datetime);
	$(".summary ul li").eq(1).html("商品类型：" + shangtype);
	$(".summary ul li").eq(2).html("作者" + obj.author);
	$(".price span").eq(1).html(obj.price + "00");
	$(".span_2").html(obj.description);
	str = "";
	for(var i = 0; i < obj.image.length; i++) {
		var $src = obj.image[i];
		$src = $src.substring(0, $src.length - 4);
		$(".jp_item").eq(i).attr("src", $src + "_s.jpg");
		str += '<li><img src="' + $src + '_s.jpg" /></li>';
	}
	$(".jp_item").html(str);
	xiaotu();
}